/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aliasMatching.controller;

import aliasMatching.model.MyTableModel;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

/**
 *
 * @author amendrashrestha
 */
public class New {

    static List userList;
//    MyTableModel tableMdl;

    public static void New(List list, List username, MyTableModel mdl,
            List graphUsers, JPanel graphPanel, JPanel timeGraph, JPanel displayTimeGraph) {
        userList = list;

        if (!userList.isEmpty()) {
            userList.clear();
            username.clear();
            mdl.resetTable();
        } if (graphPanel.isVisible() && timeGraph != null) {
            graphPanel.remove(timeGraph);
            graphPanel.validate();
            graphPanel.repaint();
        }
        if (graphPanel.isVisible() && displayTimeGraph != null) {
            graphPanel.remove(displayTimeGraph);
            graphPanel.validate();
            graphPanel.repaint();
        }
    }

    public static void infoBox(String infoMessage, String location) {
        JOptionPane.showMessageDialog(null, infoMessage, "InfoBox: " + location, JOptionPane.INFORMATION_MESSAGE);
    }
}
